<ul id="${id}" name="${id}" style="padding: 0;width: 100%;background:white;">
    @for(item in list){
    <div style="display: none">
        <p style="background-color: palegreen;font-weight: bold;padding-left: 10px"
           value="${item.getTime}">${item.getTime}</p>
    </div>

    <li value="${item.customerId}" style="position: relative;padding:10px 20px;">
        <div style="display: flex;align-items: center;">
            <p style="font-weight: bold;font-size: 15px;margin: 0;width: 100px;"
               value="${item.operationTime}">${item.operationTimeOne}</p>
            <img src="https://pynnn.oss-cn-hangzhou.aliyuncs.com/timeAxis.png" style="width: 35px;">
            <p style="font-weight: bold;font-size: 15px;margin: 0;width: 100px;text-indent: 0.4em;"
               value="${item.operationTime}">${item.operationTimeTwo}</p>
        </div>
        <div style="margin-left: 116px;border-left: 4px solid #999999;padding: 7px 0 10px 25px;">
            <div style="display: flex;padding: 5px;color: #666a73;border-top: 2px solid #ff7e00;border-bottom: 2px solid #ff7e00;text-align: center">
                @if(item.isDo == 5){
                <span style="flex: 1;">门店</span>
                <span style="flex: 1;">状态</span>
                <span style="flex: 1;"  class="beyond" title="交易状态">交易状态</span>
                <span style="flex: 1.5;">牙位</span>
                <span style="flex: 2.5;">项目名称</span>
                <span style="flex: 1;">医生</span>
                <span style="flex: 1;">护士</span>
                <span style="flex: 1;">单价(元)</span>
                <span style="flex: 1;">数量</span>
                <span style="flex: 1;">单位</span>
                <span style="flex: 1;">折扣(%)</span>
                <span style="flex: 1;" class="beyond" title="折后金额(元)">折后金额(元)</span>
                <span style="flex: 1;" class="beyond" title="抵扣方式">抵扣方式</span>
                <span style="flex: 1;" class="beyond" title="抵扣金额(元)">抵扣金额(元)</span>
                <span style="flex: 1.2;" class="beyond" title="储值划扣金额(元)">储值划扣金额(元)</span>
                <span style="flex: 1;">操作</span>
                @}
                @if(item.isDo == 3  || item.isDo == 4 ){
                <span style="flex: 1;">门店</span>
                <span style="flex: 1;">状态</span>
                <span style="flex: 1;">交易状态</span>
                <span style="flex: 1.5;">首次开单时间</span>
                <span style="flex: 1;">医生</span>
                <span style="flex: 1;">护士</span>
                <span style="flex: 1;">TC</span>
                <span style="flex: 1;">本次缴费</span>
                <span style="flex: 2;">备注</span>
                <span style="flex: 1;">操作人</span>
                @}
            </div>
            <div value="${item.operationTime}"></div>
        </div>
    </li>
    <script>
        $.ajax({
            url: Feng.ctxPath + "/consultant/getOpenBillList",
            type: "post",
            data: {
                "operationTime": $("p[value='${item.operationTime}']").text(),
                "reservationsId": $("#reservationsId").val(),
            },
            success: function (data) {
                var mendian = $("#outpatientNameValue").val();
                var serviceActualPay2 = 0.00;
                var serviceActualPay1 = 0.00;
                var foldingPay2 = 0.00;
                var accountArrears2 = 0.00;
                var primaryAmount2 = 0.00;
                var serviceActualPays = 0.00;
                var depositAmounts = 0.00;
                var s1 = '';
                var s2 = '';
                var ss = "";
                var huanqiankuan = "";
                var deletediv = "";
                var doctors = "";
                var sp = '<div style="position: absolute;top: 20px;right: 20px;">' +
                    '<a href="javascript:;" style="color: #FF7E00" onclick=\'singlePrint("' + data[data.length - 1].customerId + '","' + data[data.length - 1].reservationsId + '","' + data[data.length - 1].getTime+ '","' + data[data.length - 1].operationTime + '","' + data[data.length - 1].outpatientName + '")\'>打印确认单</a>' +
                    '</div>';
                for (var i = 0; i < data.length; i++) {
                    serviceActualPay2 += parseFloat(data[i].serviceActualPay)+parseFloat(data[i].depositAmount);
                    serviceActualPay1 += parseFloat(data[i].serviceActualPay);
                    primaryAmount2 += parseFloat(data[i].payService*data[i].payServiceNum);
                    foldingPay2 += parseFloat(data[i].foldingPay);
                    accountArrears2 += parseFloat(data[i].accountArrears);
                    depositAmounts += parseFloat(data[i].depositAmount);
                    if (document.getElementById("roleName").value.indexOf("客服主管") ||
                        document.getElementById("roleName").value.indexOf("管理员")) {
                        if ((data[data.length - 1].dealStatus) == "已结账") {
                            deletediv = '<a href="javascript:;" style="color: #da6792;" onclick=\'deleteDealInfos("' + data[i].id2 + '")\'>删除</a>';
                        }
                    }
                    ss += '<div style="display: flex;padding: 5px;border-bottom: 2px solid #f5f5f5;text-align: center">' +
                        '<span style="flex: 1;" class="beyond">' + data[data.length - 1].outpatientName + '</span>' +
                        '<span style="flex: 1;" class="beyond">' + data[i].dealStatus + '</span>' +
                        '<span style="flex: 1;">' + data[i].isDoName + '</span>' +
                        '<div style="display: flex;flex-direction: column;flex: 1.5;height: 28px;"><div style="flex: 1;display: flex;border-bottom: 1px solid #999999"><div style="flex: 1;border-right: 1px solid #999999;line-height: 14px;">' + data[i].leftUp + '</div><div style="flex: 1;line-height: 14px;">' + data[i].rightUp + '</div></div><div style="flex: 1;display: flex"><div style="flex: 1;border-right: 1px solid #999999;line-height: 14px;">' + data[i].leftDown + '</div><div style="flex: 1;line-height: 14px;">' + data[i].rightDown + '</div></div></div>' +
                        '<span style="flex: 2.5;" class="beyond" title="'+ data[i].payServiceName +'">' + data[i].payServiceName + '</span>' +
                        '<span style="flex: 1;" class="beyond" title="'+ data[i].doctor +'">' + data[i].doctor + '</span>' +
                        '<span style="flex: 1;" class="beyond" title="'+ data[i].nurse +'">' + data[i].nurse + '</span>' +
                        '<span style="flex: 1;">' + data[i].payService + '</span>' +
                        '<span style="flex: 1;">' + data[i].payServiceNum + '</span>' +
                        '<span style="flex: 1;">' + data[i].unit + '</span>' +
                        '<span style="flex: 1;">' + data[i].orderDiscount + '</span>' +
                        '<span style="flex: 1;">' + parseFloat(data[i].foldingPay).toFixed(1) + '</span>' +
                        '<span style="flex: 1;">' + data[i].deductionTypeName + '</span>' +
                        '<span style="flex: 1;">' + data[i].deductionAmount + '</span>' +
                        '<span style="flex: 1.2;">' + data[i].depositAmount + '</span>' +
                        '<span style="flex: 1;">' + data[i].tcName + '</span></div>';
                    serviceActualPays += parseFloat(data[i].serviceActualPay);
                }
                huanqiankuan = '<div style="display: flex;padding: 5px;border-bottom: 2px solid #f5f5f5;text-align: center">' +
                    '<span style="flex: 1;" class="beyond">' + data[data.length - 1].outpatientName + '</span>' +
                    '<span style="flex: 1;" class="beyond">' + data[data.length - 1].dealStatus + '</span>' +
                    '<span style="flex: 1;">' + data[data.length - 1].isDoName + '</span>' +
                    '<span style="flex: 1.5;">' + data[data.length - 1].operationTime + '</span>' +
                    '<span style="flex: 1;">' + data[data.length - 1].doctor + '</span>' +
                    '<span style="flex: 1;">' + data[data.length - 1].nurse + '</span>' +
                    '<span style="flex: 1;">' + data[data.length - 1].fieldTc + '</span>' +
                    '<span style="flex: 1;">' + parseFloat(serviceActualPays+ depositAmounts).toFixed(2)+ '</span>' +
                    '<span style="flex: 2;">' + data[data.length - 1].remarks + '</span>' +
                    '<span style="flex: 1;">' + data[data.length - 1].tcName + '</span>' +
                    '</div>';
                doctors += '<div style="border-top: 2px solid #ff7e00;border-bottom: 1px solid #e2e2e2;display: flex">' +
                    '<div style="background: #f1f1f1;flex: 3;padding: 5px;"><div><span>整体折扣：</span><span>' + data[data.length - 1].wholeDiscount + '%</span></div><span>备注：</span>' + data[data.length - 1].remarks + '</div>' +
                    '<div style="flex: 1;padding: 5px 0 5px 10px;display: flex"><div style="flex: 1;padding-right: 10px;">' +
                    '<div style="display: flex"><span style="flex: 1">本单原价</span><span>' + parseFloat(primaryAmount2).toFixed(1) + '元</span></div>' +
                    '<div style="display: flex"><span style="flex: 1">本单实收</span><span>' + parseFloat(serviceActualPay2).toFixed(1) + '元</span></div>' +
                    '</div>' +
                    '<div style="flex: 1;"><div style="display: flex"><span style="flex: 1">本单费用</span><span>' + foldingPay2.toFixed(1) + '元</span></div>' +
                    '<div style="display: flex"><span style="flex: 1">本单缴费</span><span>' + serviceActualPay1.toFixed(1) + '元</span></div>' +
                    '<div style="display: flex"><span style="flex: 1">欠费</span><span>' + accountArrears2.toFixed(1) + '元</span></div></div></div></div>';
                s1 += '<div style="position: absolute;top: 20px;right: 20px;">' +
                    '<a href="javascript:;" style="margin-right: 10px;color: #FF7E00" onclick=\'reDeal("' + data[data.length - 1].customerId + '","' + data[data.length - 1].reservationsId + '","' + data[data.length - 1].operationTime + '","' + data[data.length - 1].getTime + '","' + data[data.length - 1].department + '")\'>重开此单</a>' +
                    '<a href="javascript:;" style="margin-right: 10px;color: #FF7E00" onclick=\'updateOrder("' + data[data.length - 1].customerId + '","' + data[data.length - 1].reservationsId + '","' + data[data.length - 1].operationTime + '","' + data[data.length - 1].getTime + '")\'>修改项目</a>' +
                    '<a href="javascript:;" style="margin-right: 10px;color: #FF7E00" onclick=\'deleteOrder("' + data[data.length - 1].customerId + '","' + data[data.length - 1].reservationsId + '","' + data[data.length - 1].operationTime + '","' + data[data.length - 1].getTime + '")\'>删除</a>' +
                    '<a href="javascript:;" style="color: #FF7E00" onclick=\'singlePrint("' + data[data.length - 1].customerId + '","' + data[data.length - 1].reservationsId + '","' + data[data.length - 1].getTime+ '","' + data[data.length - 1].operationTime + '","' + data[data.length - 1].outpatientName + '")\'>打印确认单</a>' +
                    '</div>';
                s2 += '<div style="position: absolute;top: 20px;right: 20px;">' +
                    '<a href="javascript:;" style="margin-right: 10px;color: #FF7E00" onclick=\'deleteOrder("' + data[data.length - 1].customerId + '","' + data[data.length - 1].reservationsId + '","' + data[data.length - 1].operationTime + '","' + data[data.length - 1].getTime + '")\'>删除</a>' +
                    '<a href="javascript:;" style="color: #FF7E00" onclick=\'singlePrint("' + data[data.length - 1].customerId + '","' + data[data.length - 1].reservationsId + '","' + data[data.length - 1].getTime+ '","' + data[data.length - 1].operationTime + '","' + data[data.length - 1].outpatientName + '")\'>打印确认单</a>' +
                    '</div>';
                if ((data[data.length - 1].dealStatus) == "已开单" && (data[data.length - 1].reservationsId) == $("#reservationsId").val()) {
                    if (data[data.length - 1].outpatientName != mendian) {
                        if(data[data.length - 1].isDoName == "消费"){
                            $("div[value='${item.operationTime}']").html(sp + ss + doctors);
                        }else {
                            $("div[value='${item.operationTime}']").html(sp + huanqiankuan);
                        }
                    } else {
                        if(data[data.length - 1].isDoName == "消费"){
                            $("div[value='${item.operationTime}']").html(s1 + ss + doctors);
                        }else {
                            $("div[value='${item.operationTime}']").html(s2 + huanqiankuan);
                        }
                    }
                } else if ((data[data.length - 1].dealStatus) == "待审核" && (data[data.length - 1].reservationsId) == $("#reservationsId").val()) {
                    if (data[data.length - 1].outpatientName != mendian) {
                        if(data[data.length - 1].isDoName == "消费"){
                            $("div[value='${item.operationTime}']").html(sp + ss + doctors);
                        }else {
                            $("div[value='${item.operationTime}']").html(sp + huanqiankuan);
                        }
                    } else {
                        if(data[data.length - 1].isDoName == "消费"){
                            $("div[value='${item.operationTime}']").html(s1 + ss + doctors);
                        }else {
                            $("div[value='${item.operationTime}']").html(s2 + huanqiankuan);
                        }
                    }
                } else if((data[data.length - 1].dealStatus) == "已结账" && (data[data.length - 1].reservationsId) == $("#reservationsId").val()) {
                    if (data[data.length - 1].outpatientName != mendian) {
                        if(data[data.length - 1].isDoName == "消费"){
                            $("div[value='${item.operationTime}']").html(sp + ss + doctors);
                        }else {
                            $("div[value='${item.operationTime}']").html(huanqiankuan);
                        }
                    }else {
                        if(data[data.length - 1].isDoName == "消费"){
                            $("div[value='${item.operationTime}']").html(sp + ss + doctors);
                        }else {
                            $("div[value='${item.operationTime}']").html(sp + huanqiankuan);
                        }
                    }
                } else if((data[data.length - 1].dealStatus) == "审核未通过" && (data[data.length - 1].reservationsId) == $("#reservationsId").val()){
                    if (data[data.length - 1].outpatientName != mendian) {
                        if(data[data.length - 1].isDoName == "消费"){
                            $("div[value='${item.operationTime}']").html( ss + doctors);
                        }else {
                            $("div[value='${item.operationTime}']").html( huanqiankuan);
                        }
                    } else {
                        if(data[data.length - 1].isDoName == "消费"){
                            $("div[value='${item.operationTime}']").html( ss + doctors);
                        }else {
                            $("div[value='${item.operationTime}']").html( huanqiankuan);
                        }
                    }
                }
            },
            error: function (data) {
                alert('没有权限，请联系系统管理员!');
                parent.layer.close(parent.layer.getFrameIndex(window.name));
            }
        });
        deleteDealInfos = function (id2) {
            if (confirm("确定删除此项目")) {
                $.ajax({
                    url: Feng.ctxPath + "/payService/deleteDealInfos",
                    type: "post",
                    data: {
                        "id2": id2
                    },
                    success: function (data) {
                        Feng.success("删除成功！");
                        window.location.reload();
                    },
                    error: function (data) {
                        alert('没有权限，请联系系统管理员!');
                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                    }
                });
            }
        }
    </script>
    @}
</ul>
@if(isNotEmpty(underline) && underline == 'true'){
<div class="hr-line-dashed"></div>
@}